@echo off
call .venv\Scripts\activate.bat

echo Building Manual Version...
pyinstaller --onefile --icon=files/icon/DaShou.ico --paths=. --clean ^
    --exclude-module PyQt5 ^
    --exclude-module pandas ^
    --exclude-module openpyxl ^
    --exclude-module keyboard ^
    --exclude-module numpy ^
    --exclude-module scipy ^
    --exclude-module matplotlib ^
    apps/answer_manual.py
if exist dist\answer_manual.exe move /Y dist\answer_manual.exe dist\DaShou-Manual.exe

echo.
echo Building Shortcut Version...
pyinstaller --onefile --icon=files/icon/DaShou.ico --paths=. --clean ^
    --exclude-module PyQt5 ^
    --exclude-module pandas ^
    --exclude-module openpyxl ^
    --exclude-module keyboard ^
    --exclude-module numpy ^
    --exclude-module scipy ^
    --exclude-module matplotlib ^
    apps/answer_manual.py
if exist dist\answer_shortcut.exe move /Y dist\answer_shortcut.exe dist\DaShou-Shortcut.exe

echo.
echo Building Settings Tool...
pyinstaller --onefile --noconsole --icon=files/icon/Setting.ico --paths=. --clean ^
    --exclude-module pandas ^
    --exclude-module openpyxl ^
    --exclude-module keyboard ^
    --exclude-module jieba ^
    --exclude-module openai ^
    --exclude-module dashscope ^
    --exclude-module websocket-client ^
    --exclude-module tencentcloud-sdk-python-ocr ^
    --exclude-module tencentcloud-sdk-python-hunyuan ^
    --exclude-module numpy ^
    --exclude-module scipy ^
    --exclude-module matplotlib ^
    --exclude-module aiohttp ^
    --exclude-module httpx ^
    --exclude-module anyio ^
    --exclude-module h11 ^
    --exclude-module httpcore ^
    --exclude-module sniffio ^
    apps/param_tool.py
if exist dist\param_tool.exe move /Y dist\param_tool.exe dist\DaShou-Settings.exe

echo.
echo Building Export Tool...
pyinstaller --onefile --icon=files/icon/Excel.ico --paths=. --clean ^
    --exclude-module PyQt5 ^
    --exclude-module keyboard ^
    --exclude-module jieba ^
    --exclude-module openai ^
    --exclude-module dashscope ^
    --exclude-module websocket-client ^
    --exclude-module tencentcloud-sdk-python-ocr ^
    --exclude-module tencentcloud-sdk-python-hunyuan ^
    --exclude-module scipy ^
    --exclude-module matplotlib ^
    --exclude-module aiohttp ^
    --exclude-module httpx ^
    --exclude-module anyio ^
    --exclude-module h11 ^
    --exclude-module httpcore ^
    --exclude-module sniffio ^
    apps/export_excel.py
if exist dist\export_excel.exe move /Y dist\export_excel.exe dist\DaShou-Export.exe

echo.
echo ========================================
echo Build Complete!
echo Output files in dist folder:
echo - DaShou-Manual.exe
echo - DaShou-Shortcut.exe
echo - DaShou-Settings.exe
echo - DaShou-Export.exe
echo ========================================
pause